
function main() {
        Java.perform(function (){
        

            if(true)
            Java.use("android.app.Activity").onCreate .overload('android.os.Bundle').implementation = function (bundle){

                console.log(this.getClass().getName());
                var activityName = this.getClass().getName()
                if ( activityName .indexOf('UnityPlayer')>0 ){
                    this.onCreate(bundle)
                }else{

                    this.onCreate(bundle)
                    this.finish()

                }

            
        }

        var moduleName = "libil2cpp.so";
        var setTimeScale = null
        var getTimeScale = null
        
        Interceptor.attach(Module.findExportByName(null, "dlopen"), {
            onEnter: function(args) {
                this.lib = Memory.readUtf8String(args[0]);
                console.log("dlopen called with: " + this.lib);
            },
            onLeave: function(retval) {

                if (this.lib.endsWith('libunity.so')) {
                    var baseAddr = Module.findBaseAddress('libunity.so');
                    //0xF2D6C jiasu
         
         

                }

                if (this.lib.endsWith(moduleName)) {
                    console.log("ret: " + retval);
                    var baseAddr = Module.findBaseAddress(moduleName)
                    console.log("baseAddr: " + baseAddr)

       

            



            


                }
            }
        });

        var fileName
        var dlopen_ext = Module.findExportByName(null, 'android_dlopen_ext')
        Interceptor.attach(dlopen_ext, {
            onEnter: function (args) {

                fileName = ptr(args[0]).readCString()
                console.log(fileName)

            }, onLeave: function (ret) {
                if (fileName.endsWith(moduleName)) {

                    var baseAddr = Module.findBaseAddress(moduleName);
                    console.log("baseAddr")
                    console.log(baseAddr)

                }
                return ret
            }
        })


    })
}
setImmediate( main );


// conda activate py38env
// frida -U com.zjqd.mzxq.aligames -l u3dil2c
// frida -U com.cyou.xjikp5.aligames -l hookjnionload.js
// frida -U --no-pause -f com.cyou.xjikp5.aligames -l hookjnionload.js
// frida -U --no-pause -f com.youzu.ss0.aligames -l hookjnionload.js
// frida -U --no-pause -f com.yrtgame.stickvar.aligames -l hookjnionload.js
// frida -U -f com.yrtgame.stickvar.aligames -l hookjnionload.js
// frida -U -f war.of.islands -l hookjnionload.js











